package com.example.springboot.entity;

import lombok.Data;
import jakarta.persistence.*;

@Data
@Entity
@Table(name = "destination_stats")
public class DestinationStats {
    
    @Id
    private Long id;
    
    @Column(name = "destination_id")
    private Long destinationId;
    
    @Column(name = "visit_count")
    private Integer visitCount;
    
    @Column(name = "review_count")
    private Integer reviewCount;
    
    @Column(name = "favorite_count")
    private Integer favoriteCount;
    
    // 添加缺失的属性
    @Transient
    private Double avgRating;
    
    @Transient
    private Integer storyCount;
    
    @Transient
    private Integer routeCount;
    
    // 关联的目的地
    @OneToOne
    @JoinColumn(name = "destination_id", insertable = false, updatable = false)
    private Destination destination;
}
